﻿@model BlackBird.Models.PlanViewDM
@using BlackBird.Models           
@using BlackBird.Resources

@{
    ViewBag.Title = "ProjectPlan";
}



@section title_toolbar
{

    <nav>
        <ul id="button_command">
            <li><a class="newplan">@BBStrings.NewPlan</a></li>
            <li><a class="deleteplan">@BBStrings.Delete</a></li>
            <li><span class="returnHome">@Html.ActionLink(BBStrings.ReturnHome, "Index", "Home")</span></li>
        </ul>
    </nav>
}

<div id = "new_plan_form">
    @{ Html.RenderPartial(MVC.Shared.Views.Plan.NewPlanView, Model.NewPlanView);}
</div>

<div id = "project_plan_view" data-projectid = "@Model.ParentId">

    <table>
    <tbody>

    @foreach(KeyValuePair<string,List<PlanViewItemDM> > item in Model.DateToItems) 
    { 
       
       <tr data-itemdate = "@item.Key" class = "@(item.Key == DateTime.Now.ToString("yyyy-MM-dd") ? "today":"")">

            <td class = "plan_item_data">
                <span>@item.Key</span>
            </td>
            <td>
                <div class = "incomeitems">
                    @foreach (PlanViewItemDM planItem in item.Value)
                    {
                        if (planItem.type == SupportTypes.Income)
                        {
                            <span class = "item item_income @(planItem.Status == SupportTypeStatus.JiHua?"item_plan":"")" data-id = "@planItem.Id" data-comment="@planItem.Comment">@planItem.Name</span>
                        }
                    }
                </div>
            </td>

            <td>
                <div  class = "expenditems">
                    @foreach (PlanViewItemDM planItem in item.Value)
                    {
                        if (planItem.type == SupportTypes.Expend)
                        {
                            <span class = "item item_expend @(planItem.Status == SupportTypeStatus.JiHua?"item_plan":"")" data-id = "@planItem.Id" data-comment="@planItem.Comment">@planItem.Name</span>
                        }
                    }

                </div>
            </td>
            <td>
                <div  class = "eventitems">

                    @foreach (PlanViewItemDM planItem in item.Value)
                    {
                        if (planItem.type == SupportTypes.Event)
                        {
                            <span class = "item item_event @(planItem.Status == SupportTypeStatus.JiHua?"item_plan":"")" data-id = "@planItem.Id" data-comment="@planItem.Comment">@planItem.Name</span>
                        }
                    }

                </div>
            </td>
        </tr>
    }

    </tbody>
    </table>
</div>

